import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { TSpiritEquipStrengthen } from "../../../Message/Db/Tables/TSpiritEquipStrengthen";
type int = number;
//class SpiritEquipStrengthenConfig
    
    export  class SpiritEquipStrengthenConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (SpiritEquipStrengthenConfig._instance != null) 
            {
                throw new Error("SpiritEquipStrengthenConfig 单例");
            }
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_spirit_equip_strengthen.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TSpiritEquipStrengthen();
                loc1.coinCost = loc2.coinCost;
                loc1.color = loc2.color;
                loc1.level = loc2.level;
                loc1.percentAdd = loc2.percentAdd;
                loc1.spiritCoinCost = loc2.spiritCoinCost;
                this._map[loc1.color + "_" + loc1.level] = loc1;
            }
            return;
        }

        public getSpiritEquipStrengthenInfo(arg1: int, arg2: int): TSpiritEquipStrengthen
        {
            return this._map[arg1 + "_" + arg2];
        }

        public static get instance(): SpiritEquipStrengthenConfig
        {
            if (SpiritEquipStrengthenConfig._instance == null) 
            {
                SpiritEquipStrengthenConfig._instance = new SpiritEquipStrengthenConfig();
            }
            return SpiritEquipStrengthenConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: SpiritEquipStrengthenConfig;
    }
